package com.ybkj.o2o.zhuanche.entity;

import com.ybkj.o2o.zhuanche.common.json.DateTimeJsonSerializer;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;
import java.util.Date;


/**
 * 服务类型.
 * @author hqb
 */
public class ServiceType implements Serializable {
  private Long id;
  @JsonSerialize(using = DateTimeJsonSerializer.class)
  private Date created;
  @JsonSerialize(using = DateTimeJsonSerializer.class)
  private Date updated;

  private Long carTypeId;

  private Long areaId;

  private String areaName;

  private String name;// tangzu,rizu,banrizu,jieji,songji,jiezhan,songzhan

  private String typeName;// 趟租,日租,半日租,接机,送机,接站,送站

  private String appKey;

  private Long carTypeCompanyId;// 车型公司关联Id

  public Long getCarTypeCompanyId() {
    return carTypeCompanyId;
  }

  public void setCarTypeCompanyId(Long carTypeCompanyId) {
    this.carTypeCompanyId = carTypeCompanyId;
  }

  private static final long serialVersionUID = 1L;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Date getCreated() {
    return created;
  }

  public void setCreated(Date created) {
    this.created = created;
  }

  public Date getUpdated() {
    return updated;
  }

  public void setUpdated(Date updated) {
    this.updated = updated;
  }

  public Long getCarTypeId() {
    return carTypeId;
  }

  public void setCarTypeId(Long carTypeId) {
    this.carTypeId = carTypeId;
  }

  public Long getAreaId() {
    return areaId;
  }

  public void setAreaId(Long areaId) {
    this.areaId = areaId;
  }

  public String getAreaName() {
    return areaName;
  }

  public void setAreaName(String areaName) {
    this.areaName = areaName == null ? null : areaName.trim();
  }


  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getTypeName() {
    return typeName;
  }

  public void setTypeName(String typeName) {
    this.typeName = typeName == null ? null : typeName.trim();
  }

  public String getAppKey() {
    return appKey;
  }

  public void setAppKey(String appKey) {
    this.appKey = appKey == null ? null : appKey.trim();
  }

  @Override
  public boolean equals(Object that) {
    if (this == that) {
      return true;
    }
    if (that == null) {
      return false;
    }
    if (getClass() != that.getClass()) {
      return false;
    }
    ServiceType other = (ServiceType) that;
    return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
        && (this.getCreated() == null ? other.getCreated() == null : this.getCreated().equals(
            other.getCreated()))
        && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(
            other.getUpdated()))
        && (this.getCarTypeId() == null ? other.getCarTypeId() == null : this.getCarTypeId()
            .equals(other.getCarTypeId()))
        && (this.getAreaId() == null ? other.getAreaId() == null : this.getAreaId().equals(
            other.getAreaId()))
        && (this.getAreaName() == null ? other.getAreaName() == null : this.getAreaName().equals(
            other.getAreaName()))
        && (this.getName() == null ? other.getName() == null : this.getName().equals(
            other.getName()))
        && (this.getTypeName() == null ? other.getTypeName() == null : this.getTypeName().equals(
            other.getTypeName()))
        && (this.getAppKey() == null ? other.getAppKey() == null : this.getAppKey().equals(
            other.getAppKey()));
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
    result = prime * result + ((getCreated() == null) ? 0 : getCreated().hashCode());
    result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
    result = prime * result + ((getCarTypeId() == null) ? 0 : getCarTypeId().hashCode());
    result = prime * result + ((getAreaId() == null) ? 0 : getAreaId().hashCode());
    result = prime * result + ((getAreaName() == null) ? 0 : getAreaName().hashCode());
    result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
    result = prime * result + ((getTypeName() == null) ? 0 : getTypeName().hashCode());
    result = prime * result + ((getAppKey() == null) ? 0 : getAppKey().hashCode());
    return result;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append(getClass().getSimpleName());
    sb.append('[');
    sb.append("Hash = ").append(hashCode());
    sb.append(", id=").append(id);
    sb.append(", created=").append(created);
    sb.append(", updated=").append(updated);
    sb.append(", carTypeId=").append(carTypeId);
    sb.append(", areaId=").append(areaId);
    sb.append(", areaName=").append(areaName);
    sb.append(", name=").append(name);
    sb.append(", typeName=").append(typeName);
    sb.append(", appKey=").append(appKey);
    sb.append(", serialVersionUID=").append(serialVersionUID);
    sb.append(']');
    return sb.toString();
  }
}
